/**
 * 菜单相关请求模块
 */

import request from '@/utils/request'

// 创建或更新菜单
export const createOrUpdateMenu = (data) => {
  return request({
    method: 'POST',
    url: '/xxx/menu/saveOrUpdate',
    data
  })
}

// 获取编辑菜单详情数据
export const getEditMenuInfo = (id) => {
  return request({
    method: 'GET',
    url: '/xxx/menu/getEditMenuInfo',
    params: {
      id
    }
  })
}

// 获取所有菜单数据
export const getAllMenu = () => {
  return request({
    method: 'GET',
    url: '/xxx/menu/getAll'
  })
}

// 删除菜单
export const deleteMenu = (id) => {
  return request({
    method: 'DELETE',
    url: '/xxx/menu/' + id
  })
}
